package cn.vcjf.weapp.api.user.entity;

import cn.vcjf.weapp.common.TableAlias;
import cn.vcjf.weapp.common.web.JsonDateTypeConvert;
import cn.vcjf.weapp.common.web.PageModel;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * <p>
    * 
    * </p>
 *
 * @author zhengzihang
 * @since 2018-09-25
 */
@TableName("vc_user_comment")
@TableAlias("uc")
public class UserComment extends PageModel<UserComment> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @NotNull
    private Integer userId;
    @NotNull
    private Integer orderId;
    /**
     * 商品ID(商品评论)
     */
    private Integer goodsId;
    /**
     * 套餐ID(套餐评论)
     */
    private Integer setmealId;

    /**
     * 评论内容
     */
    @NotNull
    private String commentText;
    /**
     * 评论回复内容
     */
    private String replyCommentText;
    /**
     * 评论图片id
     */
    private String commentFiles;

    /**
     * 满意度
     */
    @NotNull
    private Integer degreeLevel;

    /******************************************/
    /**
     * 昵称
     */
    @TableField(exist = false)
    @TableAlias("u")
    private String nickname;

    /**
     * 头像
     */
    @TableField(exist = false)
    @TableAlias("u")
    private String headPhoto;

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getSetmealId() {
		return setmealId;
	}

	public void setSetmealId(Integer setmealId) {
		this.setmealId = setmealId;
	}

	public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getHeadPhoto() {
        return headPhoto;
    }

    public void setHeadPhoto(String headPhoto) {
        this.headPhoto = headPhoto;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }
    public String getCommentText() {
        return commentText;
    }

    public void setCommentText(String commentText) {
        this.commentText = commentText;
    }
    public Integer getDegreeLevel() {
        return degreeLevel;
    }

    public void setDegreeLevel(Integer degreeLevel) {
        this.degreeLevel = degreeLevel;
    }

    public String getReplyCommentText() {
        return replyCommentText;
    }

    public void setReplyCommentText(String replyCommentText) {
        this.replyCommentText = replyCommentText;
    }

    public String getCommentFiles() {
        return commentFiles;
    }

    public void setCommentFiles(String commentFiles) {
        this.commentFiles = commentFiles;
    }

    @JsonSerialize(using = JsonDateTypeConvert.class)
    public Date getCreateDate(){
        return createTime;
    }

    @Override
    public void preInsert(){
        super.preInsert();
    }
    @Override
    public void preUpdate(){
        super.preInsert();
    }
    @Override
    public String toString() {
        return "UserComment{" +
        "id=" + id +
        ", userId=" + userId +
        ", goodsId=" + goodsId +
        ", commentText=" + commentText +
        ", degreeLevel=" + degreeLevel +
        ", createUser=" + createUser +
        ", createTime=" + createTime +
        ", updateUser=" + updateUser +
        ", updateTime=" + updateTime +
        ", deleteFlag=" + deleteFlag +
        ", sysUserId=" + sysUserId +
        "}";
    }
}
